/**
 * module chart easypiechart
 */
(function() {
	'use strict';
	
	require.config({
		appDir: "/miwawa/",
		baseUrl: "resources/lib",
		paths: {
			"jquery.easypiechart": "miwawa/1.0.2/js/jquery/easypiechart/2.1.7/js/jquery.easypiechart.min"
		}
	});

	define(['jquery.easypiechart'], function(){
		return function(elem){
			jQuery(elem).each(function (i,n) {
				var size = jQuery(n).data('size');
				
		        jQuery(this).css({
		        	width: size+"px",
		        	height: size+"px",
		        	lineHeight: size+"px"
		        }).easyPieChart({
		        	size: 		size || 110,
		        	animate: 	jQuery(n).data('animate') 	 || false,
		        	lineCap: 	jQuery(n).data('linecap') 	 || "round",
		        	lineWidth: 	jQuery(n).data('linewidth')  || 4,
		            barColor: 	jQuery(n).data('barcolor') 	 || "#fefefe",
		            trackColor: jQuery(n).data('trackcolor') || "rgba(255,255,255,0.1)",
		            scaleColor: jQuery(n).data('scalecolor') || false
		        });
		    });
		}
	});
	
})(this);